package com.example.shopping_cart_api;

import com.example.common.Result;
import com.example.shopping_cart_model.entity.ShoppingCart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(
        name = "take-out-shopping",
        contextId = "take-out-shopping"
)
@Component
public interface ShoppingCartClient {
    @GetMapping("/shoppingCart/list")
    public Result<List<ShoppingCart>> list();
    @DeleteMapping("/shoppingCart/clean")
    public Result<String> clean();

    @PostMapping("/shoppingCart/add")
    public Result<ShoppingCart> add(@RequestBody ShoppingCart shoppingCart);

}
